/*
 * Group 3, User Interface Programming II (vt11)
 * Pooya | Flora | Monica | Can
 */
package vical.view.tutorial;

import java.awt.Component;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;

/**
 * The tutorial for adding task
 * 
 * @author Can
 */
public class TutorialAddTask extends GlassTutorial {

    private TutorialContainer container;

    public TutorialAddTask(TutorialContainer container) {
        super(container.getAddEntryButton(), container.getJMenuBar(), container.getContentPane());

        this.container = container;

        this.tutorialTitle = "How to add a Task?";
        this.instructions = ""
                + "To add a task, please click the 'Add Task' button to open the entry \n"
                + "dialog, fill the information required by the dialog and then click the \n"
                + "'save' button.\n"
                + "Or if you are in the Month View, you can double click a day card to \n"
                + "add a new task to that specified date. \n"
                + "Of course, you can also do it by choosing a menuitem.";
    }

    @Override
    protected Rectangle getInstructionPlace() {
        Rectangle rect = super.getInstructionPlace();
        Point location = (getPoint(liveComponent.getLocation()));
        location.translate(liveComponent.getWidth() * 2, 0);
        rect.setLocation(location);
        rect.width = 450;
        rect.height = 250;
        return rect;
    }

    @Override
    protected void mouseEventOnLiveComponent(Point mousePoint, Component component, MouseEvent e) {
        super.mouseEventOnLiveComponent(mousePoint, component, e);
        if (e.getClickCount() >= 1) {
            this.setVisible(false);
        }
    }

    @Override
    protected void instructionPanelClicked() {
    }
}
